Imports Sicop.Classi
Partial Class cbView
    Inherits System.Web.UI.UserControl



#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private _vista As String
    Private _tipo As Int16

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub


    Public Property tipo() As Int16
        Get
            Return _tipo
        End Get
        Set(ByVal Value As Int16)
            _tipo = 1
        End Set
    End Property
    Public WriteOnly Property vista() As String
        Set(ByVal Value As String)
            _vista = Value
        End Set
    End Property


    Public Sub rCombo()
        dV.DataSource = (New Connessione).getDataTable("select codice, descrizione from " & _vista)
        dV.DataTextField = "descrizione"
        dV.DataValueField = "codice"
        dV.DataBind()
    End Sub

    Public Property etichetta() As String
        Get
            Return lbCT.Text
        End Get
        Set(ByVal Value As String)
            lbCT.Text = Value
        End Set
    End Property
    Public Property sel() As String
        Get
            Return Trim(dV.SelectedValue)
        End Get
        Set(ByVal Value As String)
            Utility.selLista(dV, Value)
            'dV.SelectedValue = Value
        End Set
    End Property


    Public ReadOnly Property selIndex() As Int16
        Get
            Return dV.SelectedIndex
        End Get
    End Property

    Public ReadOnly Property selText() As String
        Get
            Return dV.SelectedItem.Text
        End Get
    End Property

End Class
